package cn.zwx.goods.svc.rpc.dto;

import lombok.Data;
import org.apache.dubbo.apidocs.annotations.RequestParam;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;


/**
 * @author zhangwenxue
 */
@Data
public class ModifySpuDTO {

    /**
     * 主键
     */
    @NotBlank(message = "商品id不能为空")
    @RequestParam(value = "主键",description = "主键")
    private String id;

    /**
     * SPU名
     */
    @Length(max = 32,message = "商品名称不能超过32位")
    @RequestParam(value = "0",description = "商品名称")
    private String name;

    /**
     * 是否新品 1-不是 2-是
     */
    @Range(min = 1,max = 2,message = "是否新品 1-不是 2-是")
    @RequestParam(value = "0",description = "是否新品 1-不是 2-是")
    private Integer newStatus;

    /**
     * 是否推荐 1-不是 2-是
     */
    @Range(min = 1,max = 2,message = "是否推荐 1-不是 2-是")
    @RequestParam(value = "0",description = "是否推荐 1-不是 2-是")
    private Integer recommendStatus;

    /**
     * 商品介绍主图
     */
    @Length(max = 256,message = "商品介绍主图不能超过256位")
    @RequestParam(value = "0",description = "商品介绍主图")
    private String mainImgUrl;

    /**
     * 图片列表
     */
    @Length(max = 1024,message = "图片列表不能超过1024位")
    @RequestParam(value = "0",description = "图片列表")
    private String images;

    /**
     * 简介
     */
    @Length(max = 256,message = "简介不能超过256位")
    @RequestParam(value = "0",description = "简介")
    private String intro;

    /**
     * 品牌ID
     */
    @RequestParam(value = "0",description = "品牌ID")
    private Integer brandId;

    /**
     * 分类id
     */
    @RequestParam(value = "0",description = "分类id")
    private Integer categoryId;

    /**

     /**
     * 父级分类id
     */
    @RequestParam(value = "0",description = "父级分类id")
    private Integer categoryPId;


    /**
     * 一级分类id
     */
    @RequestParam(value = "0",description = "一级分类id")
    private Integer categoryTopId;


    /**
     * 序号
     */
    @RequestParam(value = "0",description = "序号")
    private Integer seq;

    @Valid
    @NotNull(message = "spu属性不能为空")
    @RequestParam(value = "[]",description = "spu属性",required = true)
    private List<BuilderAttrDTO> attrSpuList;
    /**
     * sku 信息
     */
    @Valid
    @NotNull(message = "sku信息不能为空")
    @RequestParam(value = "[]",description = "sku信息",required = true)
    private List<BuilderSkuDTO> skuList;

}
